package com.jn.erp.security.sysservice;

import com.baomidou.mybatisplus.extension.service.IService;
import com.jn.erp.security.entity.SysPermission;
import com.jn.erp.security.entity.vo.RouterVo;

import java.util.List;
import java.util.Set;

/**
 * <pre>
 *
 * </pre>
 *
 * @author sunjiyong
 * @since 2024/8/28 15:44
 */
public interface SysPermissionService extends IService<SysPermission> {

    Set<String> selectMenuPermsByRoleId(Long roleId);


    Set<String> selectMenuPermsByUserId(Long userId);

    List<SysPermission> selectMenuTreeByUserId(Long userId);

    List<SysPermission> selectMenuList(SysPermission menu,Long userId);


    List<RouterVo> buildMenus(List<SysPermission> menus);

    /**
     * 校验菜单名称是否唯一
     *
     * @param menu 菜单信息
     * @return 结果
     */
     boolean checkMenuNameUnique(SysPermission menu);

     boolean hasChildByMenuId(Long menuId);

     boolean checkMenuExistRole(Long menuId);

    void recursionFn(List<SysPermission> list, SysPermission t);

    List<Long> selectMenuListByRoleId(Long roleId);



}
